package com.nutrition.health.service;

import com.nutrition.health.model.User;

import java.util.List;
import java.util.Optional;

public interface UserService {
    
    List<User> getAllUsers();
    
    Optional<User> getUserById(Long id);
    
    Optional<User> getUserByUsername(String username);
    
    Optional<User> getUserByEmail(String email);
    
    User createUser(User user);
    
    User updateUser(Long id, User userDetails);
    
    void deleteUser(Long id);
    
    boolean existsByUsername(String username);
    
    boolean existsByEmail(String email);
    
    /**
     * 验证用户密码
     * @param rawPassword 原始密码（未加密）
     * @param encodedPassword 加密后的密码
     * @return 密码是否匹配
     */
    boolean validatePassword(String rawPassword, String encodedPassword);
}